<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>创建目标</title>
    <link rel="stylesheet" type="text/css" href="../../css/tc/tc1.css"/>
    <script src="../../js/getParameter.js"></script>
    <script src="../../layui/layui.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery3.js" type="text/javascript" charset="utf-8"></script>
</head>


<body>

<script>
    $(function (){
        layui.use('layer', function(){
            var layer = layui.layer;


        let uid = getParameter("uid");
        $(".form").submit(function (){



            $.ajaxSettings.async = false;
            $.post("/target/addTarget?uid="+uid,$(this).serialize(),function (data){
                if (data=="success") {
                    layer.msg('添加成功',{icon:6,time:1000}, function(){
                        window.parent.location.reload(); //刷新父页面
                        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                        parent.layer.close(index);
                        });
                }
            })

            return false;
        })
        });

            })


</script>

<div class="cd-buttons" style="margin-top:70px ;">
    <form class="form">
        <div class="bd1">
            <div class="layui-inline">
                <label class="layui-form-label">请选择范围</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="test16" name="t_end_date" placeholder="开始 到 结束">
                </div>

            </div>

        </div>
        <div><span>目标描述：</span><br>
            <textarea style="resize:none;width: 480px;height: 200px;" name="t_describe"></textarea>
        </div>
        <input type="submit" value="提交" class="submit"/>
    </form>

</div>
<script type="text/javascript">
    layui.use('laydate', function () {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#test16'
            , type: 'datetime'
            , range: '到'
            , format: 'yyyy年M月d日H时m分s秒'
        });
    })
</script>
</body>
</html>
